package com.eland.oa.main.controller.util;

public class ContextResolver {

	public static String resolveContextMsg(String contextCode, String requestor) {		
		if (requestor.equalsIgnoreCase("login"))
			return resolveLoginContextMsg(contextCode);
		
		return null;
	}
	
	private static String resolveLoginContextMsg(String contextCode) {
		//P*
		if (contextCode.equalsIgnoreCase("P0001"))
			return "欢迎使用Eland OA系统！";
		else if (contextCode.equalsIgnoreCase("P0002"))
			return "您已经登录，无需再次登录。";
		
		//S*
		else if (contextCode.equalsIgnoreCase("S0001"))
			return "您的密码已经更改成功，请重新登录。";
		
		//W*
		else if (contextCode.equalsIgnoreCase("W0001"))
			return "系统闲置过久，session已经过期，请重新登录。";
		
		//E*
		else if (contextCode.equalsIgnoreCase("E0001"))
			return "请先登录再访问其它页面。";
		
		return null;
	}
}
